/*Ins*/
`define op 31:26
`define func 5:0
`define imm26 25:0
`define imm16 15:0
`define rs 25:21
`define rt 20:16
`define rd 15:11
`define sa 10:6

/*ALUop*/
`define ALUop_ADD     4'b0000
`define ALUop_SUB     4'b0001
`define ALUop_AND     4'b0010
`define ALUop_OR      4'b0011
`define ALUop_XOR     4'b0100
`define ALUop_NOR     4'b0101
`define ALUop_SLT     4'b0110
`define ALUop_SLTU     4'b0111
`define ALUop_SRL     4'b1000
`define ALUop_SLL     4'b1001
`define ALUop_SRA    4'b1010

/*NPCOp*/
`define NPC_NORMAL    2'b00  // sequence
`define NPC_BRANCH    2'b01  // branch
`define NPC_JR        2'b10  // jr
`define NPC_JUMP      2'b11  // jal,j
/*EXTop*/
`define EXT_SIGN      2'b00
`define EXT_ZERO      2'b01
`define EXT_LUI       2'b10       
`define EXT_SA        2'b11 
/***********************************/
/******* OP ENCODING *******/
`define OP_R    6'b000000
/******* Load Store TYPE *******/
`define OP_LW   6'b100011
`define OP_LWL	6'b100010
`define OP_LWR	6'b100110
`define OP_LH   6'b100001
`define OP_LHU  6'b100101
`define OP_LB   6'b100000
`define OP_LBU  6'b100100
`define OP_LUI  6'b001111
`define OP_SW   6'b101011
`define OP_SH   6'b101001
`define OP_SB   6'b101000
/*******     I TYPE      *******/
`define OP_ADDI 6'b001000
`define OP_ADDIU 6'b001001
`define OP_ANDI 6'b001100
`define OP_ORI  6'b001101
`define OP_SLTI 6'b001010
`define OP_SLTIU 6'b001011
`define OP_XORI 6'b001110
/*******   BRANCH TYPE   *******/
`define OP_BEQ  	6'b000100
`define OP_BGEZ 	6'b000001
`define OP_BGTZ 	6'b000111
`define OP_BLEZ 	6'b000110
`define OP_BLTZ 	6'b000001
`define OP_BNE  	6'b000101
`define OP_BGEZAL 	6'b000001
`define OP_BLTZAL 	6'b000001
/*******     J TYPE      *******/
`define OP_J    6'b000010
`define OP_JAL  6'b000011
//Func
`define FUNCT_ADD     6'b100000
`define FUNCT_SUB     6'b100010
`define FUNCT_ADDU    6'b100001
`define FUNCT_SUBU    6'b100011
`define FUNCT_AND     6'b100100
`define FUNCT_OR      6'b100101
`define FUNCT_NOR     6'b100111
`define FUNCT_XOR     6'b100110
`define FUNCT_SLL     6'b000000
`define FUNCT_SLLV    6'b000100
`define FUNCT_SRL     6'b000010
`define FUNCT_SRLV    6'b000110
`define FUNCT_SRA     6'b000011
`define FUNCT_SRAV    6'b000111
`define FUNCT_SLT     6'b101010
`define FUNCT_SLTU    6'b101011
`define FUNCT_JR      6'b001000
`define FUNCT_JALR    6'b001001
`define FUNCT_MULT    6'b011000
`define FUNCT_MULTU   6'b011001
`define FUNCT_DIV     6'b011010
`define FUNCT_DIVU    6'b011011
`define FUNCT_MFHI    6'b010000
`define FUNCT_MFLO    6'b010010
`define FUNCT_MTHI    6'b010001
`define FUNCT_MTLO    6'b010011
//B_type_opcode
`define RT_BGEZ    	5'b00001
`define RT_BGTZ    	5'b00000
`define RT_BLEZ    	5'b00000
`define RT_BLTZ    	5'b00000
`define RT_BGEZAL 	5'b10001
`define RT_BLTZAL 	5'b10000
